import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Material App',
      home: Scaffold(
        appBar: AppBar(
          title: Text('手势'),
        ),
        body: Center(
          child: Listener(
            child: Container(
              width: 200,
              height: 200,
              color: Colors.red,
            ),
            onPointerDown: (event){
              print("手指按下：${event.position}");
              print("手指按下：${event.localPosition}");
            },
            onPointerMove: (event){
              print("手指移动：$event");
            },
            onPointerSignal: (event){
              print("手指按下2：$event");
            },
            onPointerUp: (event){
              print("手指抬起：$event");
            },
            onPointerCancel: (event){
              print("手指取消：$event");
            },
          ),
        ),
      ),
    );
  }
}
